3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides a large number of functions that you can use to iterate through the components, vertices, faces, or edges of a mesh. For example, you can call the Q3Mesh_FirstMeshComponent function to get the first component in a mesh; then you can call the Q3Mesh_NextMeshComponent function to get any subsequent mesh components.
For even simpler mesh traversal, QuickDraw 3D defines a large number of macros modeled on the standard C language for statement. For example, the Q3ForEachMeshComponent macro uses the Q3Mesh_FirstMeshComponent function and the Q3Mesh_NextMeshComponent function to iterate through all the components of a mesh.
Adding or deleting vertices or faces within the scope of these iterators might produce unpredictable results.
#define Q3ForEachMeshComponent(m,c,i) \
for ( (c) = Q3Mesh_FirstMeshComponent((m),(i)); \
(c); \
(c) = Q3Mesh_NextMeshComponent((i)) )
#define Q3ForEachComponentVertex(c,v,i) \
for ( (v) = Q3Mesh_FirstComponentVertex((c),(i)); \
(v); \
(v) = Q3Mesh_NextComponentVertex((i)) )
#define Q3ForEachComponentEdge(c,e,i) \
for ( (e) = Q3Mesh_FirstComponentEdge((c),(i)); \
(e); \
(e) = Q3Mesh_NextComponentEdge((i)) )
#define Q3ForEachMeshVertex(m,v,i) \
for ( (v) = Q3Mesh_FirstMeshVertex((m),(i)); \
(v); \
(v) = Q3Mesh_NextMeshVertex((i)) )
#define Q3ForEachMeshFace(m,f,i) \
for ( (f) = Q3Mesh_FirstMeshFace((m),(i)); \
(f); \
(f) = Q3Mesh_NextMeshFace((i)) )
#define Q3ForEachMeshEdge(m,e,i) \
for ( (e) = Q3Mesh_FirstMeshEdge((m),(i)); \
(e); \
(e) = Q3Mesh_NextMeshEdge((i)) )
#define Q3ForEachVertexEdge(v,e,i) \
for ( (e) = Q3Mesh_FirstVertexEdge((v),(i)); \
(e); \
(e) = Q3Mesh_NextVertexEdge((i)) )
#define Q3ForEachVertexVertex(v,n,i) \
for ( (n) = Q3Mesh_FirstVertexVertex((v),(i)); \
(n); \
(n) = Q3Mesh_NextVertexVertex((i)) )
#define Q3ForEachVertexFace(v,f,i) \
for ( (f) = Q3Mesh_FirstVertexFace((v),(i)); \
(f); \
(f) = Q3Mesh_NextVertexFace((i)) )
#define Q3ForEachFaceEdge(f,e,i) \
for ( (e) = Q3Mesh_FirstFaceEdge((f),(i)); \
(e); \
(e) = Q3Mesh_NextFaceEdge((i)) )
#define Q3ForEachFaceVertex(f,v,i) \
for ( (v) = Q3Mesh_FirstFaceVertex((f),(i)); \
(v); \
(v) = Q3Mesh_NextFaceVertex((i)) )
#define Q3ForEachFaceFace(f,n,i) \
for ( (n) = Q3Mesh_FirstFaceFace((f),(i)); \
(n); \
(n) = Q3Mesh_NextFaceFace((i)) )
#define Q3ForEachFaceContour(f,h,i) \
for ( (h) = Q3Mesh_FirstFaceContour((f),(i)); \
(h); \
(h) = Q3Mesh_NextFaceContour((i)) )
#define Q3ForEachContourEdge(h,e,i) \
for ( (e) = Q3Mesh_FirstContourEdge((h),(i)); \
(e); \
(e) = Q3Mesh_NextContourEdge((i)) )
#define Q3ForEachContourVertex(h,v,i) \
for ( (v) = Q3Mesh_FirstContourVertex((h),(i)); \
(v); \
(v) = Q3Mesh_NextContourVertex((i)) )
#define Q3ForEachContourFace(h,f,i) \
for ( (f) = Q3Mesh_FirstContourFace((h),(i)); \
(f); \
(f) = Q3Mesh_NextContourFace((i)) )
You can use the Q3Mesh_FirstMeshComponent function to get the first component of a mesh.
TQ3MeshComponent Q3Mesh_FirstMeshComponent (
TQ3GeometryObject mesh,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstMeshComponent function returns, as its function result, the first mesh component in the mesh specified by the mesh parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstMeshComponent fills in before returning. You should pass the address of that structure to the Q3Mesh_NextMeshComponent function.
You can use the Q3Mesh_NextMeshComponent function to get the next component in a mesh.
TQ3MeshComponent Q3Mesh_NextMeshComponent (
TQ3MeshIterator *iterator);
The Q3Mesh_NextMeshComponent function returns, as its function result, the next mesh component in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstMeshComponent or Q3Mesh_NextMeshComponent . If there are no more mesh components, this function returns NULL .
You can use the Q3Mesh_FirstComponentVertex function to get the first vertex in a mesh component.
TQ3MeshVertex Q3Mesh_FirstComponentVertex (
TQ3MeshComponent component,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstComponentVertex function returns, as its function result, the first vertex in the mesh component specified by the component parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstComponentVertex fills in before returning. You should pass the address of that structure to the Q3Mesh_NextComponentVertex function.
You can use the Q3Mesh_NextComponentVertex function to get the next vertex in a mesh component.
TQ3MeshVertex Q3Mesh_NextComponentVertex (
TQ3MeshIterator *iterator);
The Q3Mesh_NextComponentVertex function returns, as its function result, the next vertex in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstComponentVertex or Q3Mesh_NextComponentVertex . If there are no more vertices, this function returns NULL .
You can use the Q3Mesh_FirstComponentEdge function to get the first edge in a mesh component.
TQ3MeshEdge Q3Mesh_FirstComponentEdge (
TQ3MeshComponent component,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstComponentEdge function returns, as its function result, the first edge in the mesh component specified by the component parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstComponentEdge fills in before returning. You should pass the address of that structure to the Q3Mesh_NextComponentEdge function.
You can use the Q3Mesh_NextComponentEdge function to get the next edge in a mesh component.
TQ3MeshEdge Q3Mesh_NextComponentEdge (TQ3MeshIterator *iterator);
The Q3Mesh_NextComponentEdge function returns, as its function result, the next edge in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstComponentEdge or Q3Mesh_NextComponentEdge . If there are no more edges, this function returns NULL .
You can use the Q3Mesh_FirstMeshVertex function to get the first vertex in a mesh.
TQ3MeshVertex Q3Mesh_FirstMeshVertex (
TQ3GeometryObject mesh,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstMeshVertex function returns, as its function result, the first vertex in the mesh specified by the mesh parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstMeshVertex fills in before returning. You should pass the address of that structure to the Q3Mesh_NextMeshVertex function.
You can use the Q3Mesh_NextMeshVertex function to get the next vertex in a mesh.
TQ3MeshVertex Q3Mesh_NextMeshVertex (TQ3MeshIterator *iterator);
The Q3Mesh_NextMeshVertex function returns, as its function result, the next vertex in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstMeshVertex or Q3Mesh_NextMeshVertex . If there are no more vertices, this function returns NULL .
You can use the Q3Mesh_FirstMeshFace function to get the first face in a mesh.
TQ3MeshFace Q3Mesh_FirstMeshFace (
TQ3GeometryObject mesh,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstMeshFace function returns, as its function result, the first face in the mesh specified by the mesh parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstMeshFace fills in before returning. You should pass the address of that structure to the Q3Mesh_NextMeshFace function.
You can use the Q3Mesh_NextMeshFace function to get the next face in a mesh.
TQ3MeshFace Q3Mesh_NextMeshFace (TQ3MeshIterator *iterator);
The Q3Mesh_NextMeshFace function returns, as its function result, the next face in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstMeshFace or Q3Mesh_NextMeshFace . If there are no more faces, this function returns NULL .
You can use the Q3Mesh_FirstMeshEdge function to get the first edge in a mesh.
TQ3MeshEdge Q3Mesh_FirstMeshEdge (
TQ3GeometryObject mesh,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstMeshEdge function returns, as its function result, the first edge in the mesh specified by the mesh parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstMeshEdge fills in before returning. You should pass the address of that structure to the Q3Mesh_NextMeshEdge function.
You can use the Q3Mesh_NextMeshEdge function to get the next edge in a mesh.
TQ3MeshEdge Q3Mesh_NextMeshEdge (TQ3MeshIterator *iterator);
The Q3Mesh_NextMeshEdge function returns, as its function result, the next edge in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstMeshEdge or Q3Mesh_NextMeshEdge . If there are no more edges, this function returns NULL .
You can use the Q3Mesh_FirstVertexEdge function to get the first edge around a vertex.
TQ3MeshEdge Q3Mesh_FirstVertexEdge (
TQ3MeshVertex vertex,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstVertexEdge function returns, as its function result, the first edge around the vertex specified by the vertex parameter, in a counterclockwise ordering. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstVertexEdge fills in before returning. You should pass the address of that structure to the Q3Mesh_NextVertexEdge function.
You can use the Q3Mesh_NextVertexEdge function to get the next edge around a vertex, in a counterclockwise order.
TQ3MeshEdge Q3Mesh_NextVertexEdge (TQ3MeshIterator *iterator);
The Q3Mesh_NextVertexEdge function returns, as its function result, the next edge counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstVertexEdge or Q3Mesh_NextVertexEdge . If there are no more edges, this function returns NULL .
You can use the Q3Mesh_FirstVertexVertex function to get the first vertex connected to a vertex by an edge.
TQ3MeshVertex Q3Mesh_FirstVertexVertex (
TQ3MeshVertex vertex,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstVertexVertex function returns, as its function result, the first vertex neighboring the vertex specified by the vertex parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstVertexVertex fills in before returning. You should pass the address of that structure to the Q3Mesh_NextVertexVertex function.
You can use the Q3Mesh_NextVertexVertex function to get the next vertex connected to a vertex by an edge, in a counterclockwise order.
TQ3MeshVertex Q3Mesh_NextVertexVertex (TQ3MeshIterator *iterator);
The Q3Mesh_NextVertexVertex function returns, as its function result, the next vertex counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstVertexVertex or Q3Mesh_NextVertexVertex . If there are no more vertices, this function returns NULL .
You can use the Q3Mesh_FirstVertexFace function to get the first face around a vertex.
TQ3MeshFace Q3Mesh_FirstVertexFace (
TQ3MeshVertex vertex,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstVertexFace function returns, as its function result, the first face around the vertex specified by the vertex parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstVertexFace fills in before returning. You should pass the address of that structure to the Q3Mesh_NextVertexVertex function.
You can use the Q3Mesh_NextVertexFace function to get the next face around a vertex, in a counterclockwise order.
TQ3MeshFace Q3Mesh_NextVertexFace (TQ3MeshIterator *iterator);
The Q3Mesh_NextVertexFace function returns, as its function result, the next face counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstVertexFace or Q3Mesh_NextVertexFace . If there are no more faces, this function returns NULL .
You can use the Q3Mesh_FirstFaceEdge function to get the first edge of a mesh face.
TQ3MeshEdge Q3Mesh_FirstFaceEdge (
TQ3MeshFace face,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstFaceEdge function returns, as its function result, the first edge of the face specified by the face parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstFaceEdge fills in before returning. You should pass the address of that structure to the Q3Mesh_NextFaceEdge function.
You can use the Q3Mesh_NextFaceEdge function to get the next edge of a mesh face, in a counterclockwise order.
TQ3MeshEdge Q3Mesh_NextFaceEdge (TQ3MeshIterator *iterator);
The Q3Mesh_NextFaceEdge function returns, as its function result, the next edge counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstFaceEdge or Q3Mesh_NextFaceEdge . If there are no more edges, this function returns NULL . This function iterates over all the contours in the face.
You can use the Q3Mesh_FirstFaceVertex function to get the first vertex of a mesh face.
TQ3MeshVertex Q3Mesh_FirstFaceVertex (
TQ3MeshFace face,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstFaceVertex function returns, as its function result, the first vertex of the face specified by the face parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstFaceVertex fills in before returning. You should pass the address of that structure to the Q3Mesh_NextFaceVertex function.
You can use the Q3Mesh_NextFaceVertex function to get the next vertex of a mesh face, in a counterclockwise order.
TQ3MeshVertex Q3Mesh_NextFaceVertex (TQ3MeshIterator *iterator);
The Q3Mesh_NextFaceVertex function returns, as its function result, the next vertex counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstFaceVertex or Q3Mesh_NextFaceVertex . If there are no more vertices, this function returns NULL . This function iterates over all the contours in the face.
You can use the Q3Mesh_FirstFaceFace function to get the first face surrounding a mesh face.
TQ3MeshFace Q3Mesh_FirstFaceFace (
TQ3MeshFace face,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstFaceFace function returns, as its function result, the first face surrounding the face specified by the face parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstFaceFace fills in before returning. You should pass the address of that structure to the Q3Mesh_NextFaceFace function.
You can use the Q3Mesh_NextFaceFace function to get the next face surrounding a mesh face, in a counterclockwise order.
TQ3MeshFace Q3Mesh_NextFaceFace (TQ3MeshIterator *iterator);
The Q3Mesh_NextFaceFace function returns, as its function result, the next face counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstFaceFace or Q3Mesh_NextFaceFace . If there are no more faces, this function returns NULL .
You can use the Q3Mesh_FirstFaceContour function to get the first contour of a mesh face.
TQ3MeshContour Q3Mesh_FirstFaceContour (
TQ3MeshFace face,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstFaceContour function returns, as its function result, the first contour of the face specified by the face parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstFaceContour fills in before returning. You should pass the address of that structure to the Q3Mesh_NextFaceContour function.
You can use the Q3Mesh_NextFaceContour function to get the next contour of a mesh face.
TQ3MeshContour Q3Mesh_NextFaceContour (
TQ3MeshIterator *iterator);
The Q3Mesh_NextFaceContour function returns, as its function result, the next contour in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstFaceContour or Q3Mesh_NextFaceContour . If there are no more contours, this function returns NULL .
You can use the Q3Mesh_FirstContourEdge function to get the first edge of a mesh contour.
TQ3MeshEdge Q3Mesh_FirstContourEdge (
TQ3MeshContour contour,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstContourEdge function returns, as its function result, the first edge of the mesh contour specified by the contour parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstContourEdge fills in before returning. You should pass the address of that structure to the Q3Mesh_NextContourEdge function.
You can use the Q3Mesh_NextContourEdge function to get the next edge of a mesh contour, in a counterclockwise order.
TQ3MeshEdge Q3Mesh_NextContourEdge (TQ3MeshIterator *iterator);
The Q3Mesh_NextContourEdge function returns, as its function result, the next edge counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstContourEdge or Q3Mesh_NextContourEdge . If there are no more edges, this function returns NULL .
You can use the Q3Mesh_FirstContourVertex function to get the first vertex of a mesh contour.
TQ3MeshVertex Q3Mesh_FirstContourVertex (
TQ3MeshContour contour,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstContourVertex function returns, as its function result, the first vertex of the mesh contour specified by the contour parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstContourVertex fills in before returning. You should pass the address of that structure to the Q3Mesh_NextContourVertex function.
You can use the Q3Mesh_NextContourVertex function to get the next vertex of a mesh contour, in a counterclockwise order.
TQ3MeshVertex Q3Mesh_NextContourVertex (
TQ3MeshIterator *iterator);
The Q3Mesh_NextContourVertex function returns, as its function result, the next vertex in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstContourVertex or Q3Mesh_NextContourVertex . If there are no more vertices, this function returns NULL .
You can use the Q3Mesh_FirstContourFace function to get the first face surrounding a mesh contour.
TQ3MeshFace Q3Mesh_FirstContourFace (
TQ3MeshContour contour,
TQ3MeshIterator *iterator);
The Q3Mesh_FirstContourFace function returns, as its function result, the first face of the mesh contour specified by the contour parameter. The iterator parameter is a pointer to a mesh iterator structure that Q3Mesh_FirstContourFace fills in before returning. You should pass the address of that structure to the Q3Mesh_NextContourFace function.
You can use the Q3Mesh_NextContourFace function to get the next face surrounding a mesh contour, in a counterclockwise order.
TQ3MeshFace Q3Mesh_NextContourFace (TQ3MeshIterator *iterator);
The Q3Mesh_NextContourFace function returns, as its function result, the next face counterclockwise in the iteration specified by the iterator parameter, which must have been filled in by a previous call to Q3Mesh_FirstContourFace or Q3Mesh_NextContourFace . If there are no more faces, this function returns NULL .
Previous | QD3D Book | Overview | Chapter Contents | Next |